<style>
#load{
    width:100%;
    height:100%;
    position:fixed;
    z-index:9999;
    background:url("images/loading_bar.gif") no-repeat center center #fff;
}
</style>
<script>
document.onreadystatechange = function () {
	var path = window.location.href;
	path = path.replace(/\/$/, "");
    path = decodeURIComponent(path);
	var pageUrl		=	path;
	sessionStorage.setItem( 'pageUrl', JSON.stringify(pageUrl) );
  
  var state = document.readyState
  if (state == 'interactive') {
       document.getElementById('contents').style.visibility="hidden";
  } else if (state == 'complete') {
      setTimeout(function(){
	   if(typeof sessionStorage["shop_user_id"]!='undefined'){
	   //alert(sessionStorage["shop_user_id"]);return false;
	   		document.getElementById('interactive');
			document.getElementById('load').style.visibility="hidden";
			document.getElementById('contents').style.visibility="visible";
		 }else{
		 
			window.location="index.html";
		 }
      },400);
  }
}
</script>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script src="js/webserviceurl.js"></script>
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap-alert.js"></script>
<script src="js/validations.js"></script>
<script src="js/commonfunctions.js"></script>
<script src="js/text.js"></script>
<link href="css/style.css" rel="stylesheet">
<link href="css/default.css" rel="stylesheet">
<link href="css/responsive.css" rel="stylesheet">
<script>

$(window).load(function(){
	$('#sidemenu').load('side-menu.html');
	$('#header').load('header.html');
	$('#footer').load('footer.html');
	var user_id = JSON.parse(sessionStorage["shop_user_id"]);
	//alert(user_id);return false;
	$.ajax({
		type		:	'GET',
		url			:  	webServiceUrl+'registration/'+user_id,
		dataType	: 	"json",
		success: function(data){
		    //var countrydetailes;
		    //var user_statedetailes;
            //var statedetailes;
			var obj = eval("(" + data.data + ")");
			$.each(obj, function (index,Object) {
				$('#inputUser').val(Object.user_name);
				$('#inputEmail').val(Object.email);
				$('#inputPh').val(Object.phone);
				$('#alterphone').val(Object.alterphone);
				$('#location').val(Object.location);
				$('#txtArea').val(Object.address);
				$('#pincode').val(Object.pincode);
				$('#hid').val(user_id);
				/*$('#fax').val(Object.fax);
				$('#city').val(Object.city);
				var user_countrydetailes=Object.country;
				var user_statedetailes=Object.state;
				$('#hidstate').val(user_statedetailes);
				$.ajax({
					type		:	'GET',
					url			:  	webServiceUrl+'country',
					dataType	:   "json",
					success: function(data){
							var countrydetailes;
							countrydetailes +='<option value="">Select country</option>';
							var obj = eval("(" + data.data + ")");
							$.each(obj, function (index,Object) {
							    if(user_countrydetailes==Object.country_id){
								  countrydetailes +='<option  selected value="'+Object.country_id+'">'+Object.nicename+'</option>';
								}else{
								  countrydetailes +='<option  value="'+Object.country_id+'">'+Object.nicename+'</option>';
								}
							});
							$('#country').html(countrydetailes);
							getstateValues();
					}
			    });*/
				
			});	
		}
	});
});
</script>
<div id="load"></div>
<div id="contents">
  <div id="header"></div>
    <div class="container-fluid">
      <div class="row-fluid container_bg">
        <div id="sidemenu"></div>
        <div class="span9 pos_r">
			<div class="container_title">
				<div class=""><h1>My Account</h1></div>
				<div  id="success_alert" class="alert_sucess alert alert-success span11" style="display:none;">
					<i class=" icon-ok-sign"></i>&nbsp;&nbsp;
					<span  id="sucessDiv"></span>
				</div>
				<div class="container_form_top">
				<form class="form-horizontal" id="accountForm1" method="POST">
					<div class="control-group">
						<label class="control-label" for="inputUser">User Name</label>
						<div class="controls">
						<input type="text" class="span8" id="inputUser" name="inputUser"   placeholder="User Name"><span id="userNameError" style="color:red"></span>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="inputEmail">Email</label>
						<div class="controls">
						<input type="text" class="span8" id="inputEmail" name="inputEmail" placeholder="Email" disabled><span id="emailError" style="color:red"></span>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="inputPh">Phone Number</label>
						<div class="controls">
						<input type="text" class="span8" id="inputPh" name="inputPh" placeholder="Phone Number"><span style="color:red" id="phoneNumberError"></span>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="inputPh">Alterphonenumber</label>
						<div class="controls">
						<input type="text" class="span8" id="alterphone" name="alterphone" placeholder="Please Enter Telephone Number">
						<span id="erroralterphone" name="erroralterphone" style="color:red"></span>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="location">Location</label>
						<div class="controls">
						<input type="text" class="span8" id="location" name="location" placeholder="Please Enter location">
						<span id="errorLocation" name="errorLocation" style="color:red"></span>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="txtArea">Address</label>
						<div class="controls">
						<textarea rows="3" class="span8" id="txtArea" name="txtArea"></textarea><span style="color:red" id="addressError"></span>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="pincode">Pincode</label>
						<div class="controls">
						<input type="text" class="span8" id="pincode" name="pincode" placeholder="Please Enter pincode">
						<span id="errorPincode" name="errorPincode" style="color:red"></span>
						</div>
					</div>
					<!--<div class="control-group">
						<label class="control-label" for="fax">Fax</label>
						<div class="controls">
						<input type="text" class="span8" id="fax" name="fax" placeholder="Please Enter fax">
						<span id="errorFax" name="errorFax" style="color:red"></span>
						</div>
					</div>
					
					
					<div class="control-group">
						<label class="control-label" for="city">City</label>
						<div class="controls">
						<input type="text" class="span8" id="city" name="city" placeholder="Please Enter city">
						<span id="errorCity" name="errorCity" style="color:red"></span>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="country">Country</label>
						<div class="controls">
						<select class="span8" id="country" name="country" onchange="return getstateValues()"   placeholder="Select Country">
						</select>
						<span id="errorcountry" name="errorcountry" style="color:red"></span>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="state">State</label>
						<div class="controls">
						<select class="span8" id="state" name="state" placeholder="">
						</select>
						<span id="errorstate" name="errorstate" style="color:red"></span>
						</div>
					</div>-->
					<input type="hidden" id="hid" name="hid">
					<input type="hidden" id="status" name="status" value="1">
					<div class="control-group">
						<div class="controls">
						<button type="button" class="medicart_btn" onclick="myAccountForm()">SAVE</button><span id="accountReload"></span>
						</div>
					</div>
				</form>
				
				</div>
			</div>
          
        </div><!--/span-->
      </div><!--/row-->
    </div><!--/.fluid-container-->
<div id="footer"></div>
</div>
